/*
 * Emu v4l2 header file.
 *
 * Copyright (C) 2015 Ingenic Semiconductor Co.,Ltd
 * Author: Niky <xianghui.shen@ingenic.com>
 */

#ifndef __EMU_V4L2_H__
#define __EMU_V4L2_H__

#include <linux/videodev2.h>
#include <linux/v4l2-mediabus.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <linux/spi/spidev.h>

#include <imp/imp_isp.h>
#ifdef __cplusplus
#if __cplusplus
extern "C"
{
#endif
#endif /* __cplusplus */

/**
 * @file
 * ISP模块头文件
 */

typedef struct {
	uint16_t maxwidth;
	uint16_t maxheight;
	uint16_t minwidth;
	uint16_t minheight;
} EmuV4L2Scalercap;

typedef struct {
	uint16_t outwidth;
	uint16_t outheight;
} EmuV4L2Scaler;


/* define common struct */
enum tx_isp_priv_ioctl_direction {
	TX_ISP_PRIVATE_IOCTL_SET,
	TX_ISP_PRIVATE_IOCTL_GET,
};

/* isp image tuning */
struct isp_image_tuning_default_ctrl {
	enum tx_isp_priv_ioctl_direction dir;
	struct v4l2_control control;
};

#define VIDIOC_REGISTER_SENSOR		 _IOW('V', BASE_VIDIOC_PRIVATE, IMPSensorInfo)
#define VIDIOC_RELEASE_SENSOR		 _IOW('V', BASE_VIDIOC_PRIVATE + 1, IMPSensorInfo)
//#define VIDIOC_ISP_PRIVATE_IOCTL	 _IOW('V', BASE_VIDIOC_PRIVATE + 2, struct isp_private_ioctl)
#define VIDIOC_DEFAULT_CMD_BYPASS_ISP	 _IOW('V', BASE_VIDIOC_PRIVATE + 3, int)
#define VIDIOC_DEFAULT_CMD_SCALER_CAP	 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, EmuV4L2Scalercap)
#define VIDIOC_DEFAULT_CMD_SET_SCALER	 _IOW('V', BASE_VIDIOC_PRIVATE + 5, EmuV4L2Scaler)

#define VIDIOC_DEFAULT_CMD_ISP_TUNING	 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct isp_image_tuning_default_ctrl)

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */

/**
 * @}
 */

#endif /* __EMU_V4L2_H__ */
